var i=0, file;
if (!file_exists(working_directory + global.filename)){
    show_message("Dungeon File Missing( "+global.filename+" ), Check here: " + working_directory);
    game_end();
} else {
    file = file_text_open_read(working_directory + global.filename);
    while (!file_text_eof(file))
        {
        file_text_readln(file);
        scr_name[i] = file_text_read_string(file);
        for(a=0;a < string_length(scr_name[i]);a++)
        {
            dungeon[i,a] = string_char_at(scr_name[i],a+1);
        }
        i++;
        }

    file_text_close(file);

    for (mapy = 0; mapy < array_height_2d(dungeon); mapy++)
    {
        for (mapx = 0; mapx < array_length_2d(dungeon,mapy);mapx++)
        {
            if (string(dungeon[mapy,mapx]) == "1")
            {
                instance_create(mapx*global.wallwidth,mapy*global.wallwidth,obj_wall);
            }
        }
    }
}

